#include "borrowing.h"

Borrowing::Borrowing()
{

}

Borrowing::Borrowing(QString Bor_number, QString Stu_number, QString Book_number, QDate BorrowingTime, QDate Return)
{
    this->bor_number = Bor_number;
    this->stu_number = Stu_number;
    this->book_number = Book_number;
    this->bor_BorrowingTime = BorrowingTime;
    this->bor_Return = Return;
}

Borrowing::Borrowing(QStringList data)
{
    this->bor_number = data[0];
    this->stu_number = data[1];
    this->book_number = data[2];
    this->bor_BorrowingTime =QDate::fromString(data[3],"yyyy年MM月dd日");
    this->bor_Return = QDate::fromString(data[4],"yyyy年MM月dd日");
}

QStringList Borrowing::getBorrowing()
{
    QStringList ret;
    ret.append(this->bor_number);
    ret.append(this->stu_number);
    ret.append(this->book_number);
    ret.append(this->bor_BorrowingTime.toString("yyyy年MM月dd日"));
    ret.append(this->bor_Return.toString("yyyy年MM月dd日"));
    return ret;
}
